* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    color: #333;
    background-attachment: fixed;
}

h1 {
    text-align: center;
    color: white;
    margin: 25px 0;
    font-size: 2.8em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.4);
    font-weight: 700;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 15px;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 2px;
}

h2 {
    color: white;
    text-align: center;
    margin: 18px 0;
    font-size: 1.9em;
    font-weight: 600;
}

#msg-form {
    background: white;
    padding: 28px;
    border-radius: 15px;
    margin: 25px auto;
    max-width: 800px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.12);
    border: none;
}

#msg-form h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.9em;
}

#msg-form label {
    display: block;
    margin: 16px 0 6px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.05em;
}

#msg-form input[type="text"],
#msg-form textarea {
    width: 100%;
    padding: 13px;
    margin: 8px 0;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

#msg-form input[type="text"]:focus,
#msg-form textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
    background: white;
}

#msg-form textarea {
    min-height: 125px;
    resize: vertical;
}

#msg-form input[type="submit"] {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 16px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 18px;
    letter-spacing: 0.5px;
}

#msg-form input[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.35);
    background: linear-gradient(135deg, #2980b9, #3498db);
}

#msg-table {
    width: 92%;
    margin: 32px auto;
    border-collapse: collapse;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.12);
    border: none;
}

#msg-table th {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 20px;
    text-align: left;
    font-weight: 600;
    font-size: 1.1em;
    letter-spacing: 0.5px;
}

#msg-table td {
    padding: 18px;
    border-bottom: 1px solid #e1e8ed;
    transition: all 0.3s ease;
    vertical-align: top;
}

#msg-table tr:last-child td {
    border-bottom: none;
}

#msg-table tr:hover td {
    background: #f8f9fa;
    transform: scale(1.01);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

#msg-table tr:nth-child(even) {
    background: #f8f9fa;
}

#msg-table tr:hover {
    background: #e3f2fd;
}

#msg-table td:nth-child(2) {
    word-break: break-word;
    max-width: 400px;
}

#msg-table td:nth-child(3) {
    color: #7f8c8d;
    font-size: 0.95em;
    white-space: nowrap;
}

hr {
    border: none;
    height: 3px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.5), transparent);
    margin: 32px 0;
    width: 85%;
    margin-left: auto;
    margin-right: auto;
    border-radius: 3px;
}

.message-count {
    background: #e74c3c;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9em;
    margin-left: 12px;
    font-weight: 600;
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    h1 {
        font-size: 2.2em;
    }

    h2 {
        font-size: 1.6em;
    }

    #msg-form {
        padding: 20px;
        margin: 12px;
    }

    #msg-table {
        width: 100%;
        margin: 22px 0;
        display: block;
        overflow-x: auto;
    }

    #msg-table th,
    #msg-table td {
        padding: 14px 10px;
        font-size: 0.9em;
    }
}

body:has(center) {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

center {
    background: white;
    padding: 45px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    text-align: center;
    max-width: 700px;
    width: 90%;
}

center h1 {
    color: #2c3e50;
    text-shadow: none;
    margin-bottom: 35px;
    font-size: 2.8em;
}

center a {
    display: inline-block;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

center a:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.35);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1, #msg-form, #msg-table, center {
    animation: fadeInUp 0.6s ease-out;
}